package com.zx.platform.dao;

import java.util.List;

import org.springframework.dao.DataAccessException;

import com.zx.platform.dao.model.RoleMenusTemp;
import com.zx.platform.dao.model.Roles;
import com.zx.platform.dao.model.RolesExample;

public interface RolesDao {

	/**
	 * 新增
	 * 
	 * @param Roles
	 * @return
	 * @throws DataAccessException
	 */
	public Integer add(Roles roles) throws DataAccessException;

	/**
	 * 更新
	 * 
	 * @param Roles
	 * @return
	 * @throws DataAccessException
	 */
	public Integer update(Roles roles) throws DataAccessException;

	/**
	 * 删除
	 * 
	 * @param Roles
	 * @throws DataAccessException
	 */
	public void delete(Roles roles) throws DataAccessException;

	/**
	 * 分页查询
	 * 
	 * @param pageSize
	 * @param pageBegin
	 * @param example
	 * @return
	 * @throws DataAccessException
	 */
	public List<Roles> getPageByExample(int pageSize, int pageBegin,
			RolesExample example) throws DataAccessException;
	/**
	 * 根据Model查找List
	 * @param pageSize
	 * @param pageBegin
	 * @param example
	 * @return
	 * @throws DataAccessException
	 */
	public List<Roles> getListByExample(RolesExample example) throws DataAccessException;
	
	/**
	 * 查找条数
	 * 
	 * @param example
	 * @return
	 * @throws DataAccessException
	 */
	public int countByExample(RolesExample example) throws DataAccessException;
	/**
	 * 根据单Key查找Model
	 * 
	 * @param example
	 * @return
	 * @throws DataAccessException
	 */
	public Roles selectByPrimaryKey(Integer key) throws DataAccessException;
	/**
	 * 设置角色菜单关联
	 * 是先删除再新增
	 */
	public Integer setRoleMenus(RoleMenusTemp roleMenusTemp) throws DataAccessException;
}